#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int compree_string(char *p)
{
	int a = 1;
	if (p == NULL)
		return;

	int count = 1;
	while (*p != '\0')
	{
		if (*p == *(p + 1))
		{
			a = 0;
			// printf("test:%c%d\n",*p,count);
			count++;
			p++;
		}
		else
		{
			if (a == 0)
				printf("%c%d", *p, count);
			count = 1;
			p++;
		}
	}

	return a;
}
int main(int argc, char *argv[])
{
	char str[500];

	scanf("%s", str);
	int x = compree_string(str);
	if (x == 1)
		printf("NO");

	return 0;
}